package cn.xutingyin.mycat.controller;

import cn.xutingyin.mycat.entity.Orders;
import cn.xutingyin.mycat.service.impl.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 订单操作控制器
 * @Author: tingyin.xu
 * @CreateDate: 2021/11/23 16:57
 */
@RestController
@RequestMapping("orders")
public class OrdersController {

    @Autowired
    private OrdersService ordersService;

    @PostMapping("list")
    public List<Orders> getList() {
        return ordersService.getList();
    }

    @PostMapping("save")
    public int save(@RequestBody Orders orders) {
        return ordersService.save(orders);
    }


}
